package com.bradz.mytv;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Gallery;
import android.widget.ImageView;

public class classTutorialImageAdapter extends BaseAdapter 
{
    private Context self;
    private int[] images;


    public classTutorialImageAdapter(Context context, int[] images) 
    {
        self = context;
        this.images = new int[images.length];
        System.arraycopy( images, 0, this.images, 0, images.length );
    }

    public int getCount() {
        return images.length;
    }

    public Object getItem(int position) {
        return position;
    }

    public long getItemId(int position) {
        return position;
    }

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		// TODO Auto-generated method stub
        ImageView i = new ImageView(self);

        i.setImageResource(images[position]);
        i.setLayoutParams(new Gallery.LayoutParams(200, 200));

        i.setScaleType(ImageView.ScaleType.FIT_XY);

        return i;
	}
}